tracing: Do not create directories if lockdown is in affect
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 2 Dec 2019 21:25:27 +0000 (16:25 -0500)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 5 Jan 2020 14:40:37 +0000 (14:40 +0000)
commit5375f3d8bd2d04126274d5f65beae5630764fee7
treed8f0c1a7467d8fe9a4f4f9b781c3a531b40b6207
parentd155966638d56c86850cabaa259bb06ba610d2b2
tracing: Do not create directories if lockdown is in affect

If lockdown is disabling tracing on boot up, it prevents the tracing files
from even bering created. But when that happens, there's several places that
will give a warning that the files were not created as that is usually a
sign of a bug.

Add in strategic locations where a check is made to see if tracing is
disabled by lockdown, and if it is, do not go further, and fail silently
(but print that tracing is disabled by lockdown, without doing a WARN_ON()).

Cc: Matthew Garrett <mjg59@google.com>
Fixes: 17911ff38aa5 ("tracing: Add locked_down checks to the open calls of files created for tracefs")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name tracing-Do-not-create-directories-if-lockdown-is-in-.patch
kernel/trace/ring_buffer.c
kernel/trace/trace.c